﻿using System;
using System.Collections.Generic;

using SBPweb.Forge.Contracts.Extensibility;

namespace SBPweb.Forge.Controls.Silverlight.Utilities
{

    public class InitialParameters : ExtendableBase
    {

        #region Constructor logic
        
        public InitialParameters(IDictionary<string, string> dictionary)
            : this(dictionary, true)
        {

        }

        public InitialParameters(IDictionary<string, string> dictionary, bool useDecryption)
            : base()
        {
            IDictionary<string, string> dict = null;
            if (useDecryption)
            {
                dict = InitialParametersHandler.DecryptParameters(dictionary, "Posta.PJR2");
            }
            else
            {
                dict = dictionary;
            }
            foreach (KeyValuePair<string, string> kvp in dict)
            {
                this.Put<string>(kvp.Key, kvp.Value);
            }
        }

        #endregion

    }

}